<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE>Readme for hello example</TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Linux)">
	<META NAME="CREATED" CONTENT="20060627;17353000">
	<META NAME="CHANGEDBY" CONTENT="kejin">
	<META NAME="CHANGED" CONTENT="20070513;11512100">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 8.5in 11in }
		P { color: #000000 }
		H2 { color: #000000 }
		H3 { color: #000000 }
		PRE { color: #000000 }
		A:link { color: #0000ff }
		A:visited { color: #990066 }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" TEXT="#000000" LINK="#0000ff" VLINK="#990066" BGCOLOR="#ffffff" DIR="LTR">
<H2>PocoCapsule/C++ Basic IoC example: STL map 
</H2>
<P>Copyright(c) 2006, 2007 by <A HREF="http://www.pocomatic.com/">Pocomatic
Software</A>. All rights reserved.</P>
<P>This example illustrates how to uses C++ templates, STL container
classes (e.g. std::map), and non-member function as post
instantiation ioc in PocoCapsule/C++. In the example, a std::map is
created and populated according to the POCO application deployment
XML description <A HREF="setup.xml">setup.xml</A>. This deployment
description further injects this map into a <A HREF="reader.h">reader
object</A> to print out its content. 
</P>
<H3>Source Files</H3>
<P><A HREF="main.C">main.C:</A> This is a simple container, used to
deploy the application. This container is completely application
logic independent. It contains no application specific code. Its
executable, after build, does not depends on (by linking to) any
application specific component modules (dynamic libraries).</P>
<P><A HREF="reader.h">reader.h</A> and <A HREF="reader.C">reader.C:</A>
These files declare and implement a global read_props() function.
This function has a std::map reference as input parameter, and prints
out its content. 
</P>
<P><A HREF="setup.xml">setup.xml:</A> This is the application setup
description. It describes the following structures:</P>
<UL>
	<LI><P><FONT SIZE=2>A bean instance of class std::map&lt;std::string,
	std::string&gt; is allocated, and populated.</FONT></P>
	<LI><P><FONT SIZE=2>Calling the read_props() global method, with
	above map instance as ioc method argument. </FONT>
	</P>
</UL>
<H3>Building this example</H3>
<P STYLE="font-weight: medium">To build this example, the environment
variable POCOCAPSULE_DIR should point to the PocoCapsule/C++
installed directory. Then, this example can be built by simply
invoking gmake/make on linux/unix or nmake on windows. 
</P>
<H3>Running this example</H3>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">Before
starting <FONT FACE="Times New Roman">the application deployment
container (i.e. the main executable)</FONT>, make sure the
LD_LIBRARY_PATH (on linux and solaris) or the PATH (on windows)
environment variable is set correctly to include the
${POCOCAPSULE_DIR}/lib directory.</FONT></P>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">start
the main executable: </FONT>
</P>
<PRE STYLE="margin-left: 0.79in; margin-bottom: 0.2in"><B>prompt&gt;</B> main </PRE><P STYLE="margin-bottom: 0.2in">
<FONT FACE="Times New Roman">It will print out the following result:</FONT></P>
<PRE STYLE="margin-left: 0.79in">map content:
compiler:        gcc
host-name:       pocomatic.com
hw-arch:         Intelx86
ip-addr:         192.168.2.2
op-system:       linux</PRE><P>
<A HREF="../../README.html">Back to the root page</A></P>
</BODY>
</HTML>
